import request from '@/utils/request'

export const loginAPI = (loginForm) => {
  return request({
    method: 'post',
    url: '/sys/login',
    // url: 'http://ihrm.itheima.net/prod-api/sys/login',
    // url: 'http://ihrm-java.itheima.net/api/sys/login',
    data: loginForm
  })
}

/**
 * 获取用户基本信息
 */
export const getUserAPI = () => {
  return request({
    method: 'post',
    url: '/sys/profile'
  })
}

/**
 * 获取获取-员工-基本信息API
 */
export const getUserInfoAPI = (id) => {
  return request({
    url: `/sys/user/${id}`
  })
}

/**
 * 获取-部门负责人列表
 */
export const getUsermenagerAPI = (id) => {
  return request({
    url: '/sys/user/simple'
  })
}

/**
 * 分配角色
 */
export const updataadUserAPI = (data) => {
  return request({
    method: 'put',
    url: '/sys/user/assignRoles',
    data
  })
}
